package com.ruoyi.project.system.cms.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.system.cms.domain.CommonCms;
import com.ruoyi.project.system.cms.mapper.CommonCmsMapper;
import com.ruoyi.project.system.cms.service.ICommonCmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 党内制度Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-15
 */
@Service
public class CommonCmsServiceImpl implements ICommonCmsService 
{
    @Autowired
    private CommonCmsMapper commonCmsMapper;

    /**
     * 查询党内制度
     * 
     * @param id 党内制度主键
     * @return 党内制度
     */
    @Override
    public CommonCms selectCommonCmsById(Long id)
    {
        return commonCmsMapper.selectCommonCmsById(id);
    }

    /**
     * 查询党内制度列表
     * 
     * @param CommonCms 党内制度
     * @return 党内制度
     */
    @Override
    public List<CommonCms> selectCommonCmsList(CommonCms CommonCms)
    {
        return commonCmsMapper.selectCommonCmsList(CommonCms);
    }

    /**
     * 新增党内制度
     * 
     * @param CommonCms 党内制度
     * @return 结果
     */
    @Override
    public int insertCommonCms(CommonCms CommonCms)
    {
        CommonCms.setCreateTime(DateUtils.getNowDate());
        CommonCms.setUpdateTime(DateUtils.getNowDate());
        return commonCmsMapper.insertCommonCms(CommonCms);
    }

    /**
     * 修改党内制度
     * 
     * @param CommonCms 党内制度
     * @return 结果
     */
    @Override
    public int updateCommonCms(CommonCms CommonCms)
    {
        CommonCms.setUpdateTime(DateUtils.getNowDate());
        return commonCmsMapper.updateCommonCms(CommonCms);
    }

    /**
     * 批量删除党内制度
     * 
     * @param ids 需要删除的党内制度主键
     * @return 结果
     */
    @Override
    public int deleteCommonCmsByIds(Long[] ids)
    {
        return commonCmsMapper.deleteCommonCmsByIds(ids);
    }

    /**
     * 删除党内制度信息
     * 
     * @param id 党内制度主键
     * @return 结果
     */
    @Override
    public int deleteCommonCmsById(Long id)
    {
        return commonCmsMapper.deleteCommonCmsById(id);
    }
}